// 制度申请流程配置
export const institutionChildren = [
    {
        key: 'Title',
        formId: 'baseInfoTitle',
        label: '制度基础信息',
        cmpType: 'common',
        tag: 'Title',
        tagIcon: 'iconprocess_common_title_icon',
        options: {},
        titleValue: '制度基础信息',
        rules: [],
        noValue: true
    },
    {
        label: '实施范围',
        formId: 'scope',
        tag: 'CompanyTree',
        autofill: true,
        // isSummary: true,
        rules: [
            {
                required: true,
                message: '请选择实施范围'
            }
        ],
        options: {
            disabled: false,
            placeholder: '请选择实施范围'
        }
    },
    {
        label: '申请日期',
        formId: 'applyDate',
        tag: 'Date',
        autofill: true,
        rules: [
            {
                required: true,
                message: '请选择申请日期'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请选择申请日期'
        }
    },
    {
        label: '制度名称',
        formId: 'institutionName',
        tag: 'Input',
        rules: [
            {
                min: 2,
                max: 40,
                required: true,
                message: '请输入2-40个字符'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请输入制度名称'
        }
    },
    {
        label: '制度编号',
        formId: 'institutionNo',
        tag: 'Input',
        isSummary: true,
        rules: [
            {
                min: 2,
                max: 40,
                required: true,
                message: '请输入2-40个字符'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请输入制度编号'
        }
    },
    {
        label: '制度类型',
        formId: 'institutionType',
        tag: 'InstitutionType',
        isSummary: true,
        proCondition: true,
        isUsed: true,
        conditionShowOption: {
            valueMode: 'multiple',
            showType: 'select',
            fetchType: 'dict',
            query: { code: 'institutionType' }
        },
        rules: [
            {
                required: true,
                message: '请选择制度类型'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请选择制度类型'
        }
    },
    {
        label: '发布类型',
        formId: 'releaseType',
        tag: 'ReleaseType',
        // isSummary: true,
        customValidatorRule: 'releaseTypeValidator',
        rules: [
            {
                required: true,
                message: '请选择已有的制度'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请关联发布类型'
        }
    },
    {
        label: '生效日期',
        formId: 'effectiveDate',
        tag: 'EffectiveDate',
        // isSummary: true,
        customValidatorRule: 'effectiveDateValidator',
        rules: [
            {
                required: true,
                message: '请指定生效日期'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请选择实施范围'
        }
    },
    {
        key: 'Title',
        label: '制度内容',
        formId: 'detailInfoTitle',
        cmpType: 'common',
        tag: 'Title',
        tagIcon: 'iconprocess_common_title_icon',
        options: {},
        titleValue: '制度内容',
        rules: [],
        noValue: true
    },
    {
        label: '制度简介',
        formId: 'institutionIntroduce',
        tag: 'TextArea',
        isSummary: true,
        rules: [
            {
                max: 200,
                min: 2,
                required: true,
                message: '请输入2-200个字符'
            }
        ],
        options: {
            disabled: true,
            placeholder: '请输入规章制度的介绍信息'
        }
    },
    {
        label: '制度文件',
        formId: 'OssUpload',
        tag: 'OssUpload',
        key: 'OssUpload',
        options: {},
        rules: [{ required: true, message: '请上传制度文件' }],
        name: 'file',
        buttonText: '点击上传附件',
        fileSize: 10,
        sizeUnit: 'MB',
        uploadProps: {
            multiple: false, // 多文件
            dragAble: false, // 是否为拖拽上传
            checkFileSize: 10, // 限制单文件上传最大值，单位为MB
            checkFileType: 'doc,docx,ppt,pptx,xls,xlsx', // 允许上传的文件格式
            maxCount: 1, // 上传的文件个数上限
            help: '只能上传1份文件且小于10MB，支持doc,docx,ppt,pptx,xls,xlsx格式' // 帮助文案
        }
    },
    {
        label: '制度关键词',
        formId: 'keywords',
        cmpType: 'common',
        tag: 'EditableTagGroup'
    }
];

export const institutionControl = {
    label: '制度申请',
    cmpType: 'custom',
    formId: '',
    key: 'Institution',
    tag: 'Institution',
    tagIcon: 'iconprocess_common_askleave_supervisor_icon',
    children: institutionChildren,
    proCondition: true,
    isUsed: false,
    formStyle: true
};
